import request from '@/utils/request.js';

//获取列表
export function selectList(query){
    return request({
        url:'/classAwards/selectList',
        method:'get',
        params:query
    })
}

export function selectClassByUserId(userId){
    return request({
        url:'/classAwards/selectClassByUserId/'+userId,
        method:'get',
    })
}
export function selectClassAwardsByUserId(userId){
    return request({
        url:'/classAwards/selectClassAwardsByUserId/'+userId,
        method:'get',
    })
}

export function checkClassAwards(awardsId,classId){
    return request({
        url:'/classAwards/checkClassAwards',
        method:'get',
        params:{
            awardsId:awardsId,
            classId:classId,
        }
    })
}
export function selectAllClass(){
    return request({
        url:'/classAwards/selectAllClass',
        method:'get'
    })
}

export function selectAllAwards(){
    return request({
        url:'/classAwards/selectAllAwards',
        method:'get'
    })
}
export function checkNum(awardsId,classId,num,str){
    return request({
        url:'/classAwards/checkNum',
        method:'get',
        params:{
            awardsId:awardsId,
            classId:classId,
            num:num,
            str:str
        }
    })
}

export function add(data){
    return request({
        url: '/classAwards/add',
        method:'post',
        data: data
    })
}

 export function update(data){
    return request({
        url:'/classAwards/update',
        method:'post',
        data:data
    })
}
export function deleteById(id){
    return request({
        url:'/classAwards/delete/'+id,
        method:'delete'
    })
}
export function deleteBatch(data){
    return request({
        url: '/classAwards/deleteBatch',
        method: 'post',
        params: {
            ids: data
        }
    })
}